package com.zzz.demo.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zzz.demo.entity.SecUser;
import com.zzz.demo.service.ISecUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ZZZ
 * @version 1.0
 * @date 2019/2/18 0018
 */
@RestController
@RequestMapping("/test")
@Slf4j
public class TestController {

    @Autowired
    ISecUserService userService;

    @GetMapping("/getUser")
    public SecUser test() {
        SecUser userInfo = userService.getOne(new QueryWrapper<SecUser>() {{
            eq("user_id", "123");
        }});
        return userInfo;
    }
}
